home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmiSoft / Dev / misc / WHDLoad_dev.lha / WHDLoad / Src / programs / WBuild.mod < prev    next >
Encoding:
Text File  |  2001-06-20  |  1.2 KB  |  55 lines

  1. (*
  2. (* :Program.    WBuild.mod
  3. ** :Contents.   increases build number
  4. ** :Author.     Bert Jahn
  5. ** :EMail.      jah@pub.th-zwickau.de
  6. ** :Address.    Franz-Liszt-Straße 16, Rudolstadt, 07404, Germany
  7. ** :History.    0.1 16.06.98
  8. ** :Copyright.  Public Domain
  9. ** :Language.   Oberon
  10. ** :Translator. Amiga Oberon 3.11 (Includes 40.15)
  11. *)
  12. *)
  13.  
  14. MODULE WBuild;
  15.  
  16. IMPORT
  17.   SYS  := SYSTEM,
  18.   conv := Conversions,
  19.   d    := Dos,
  20.   fs   := FileSystem;
  21.  
  22. CONST
  23.   version  = "$VER: WBuild V0.1 (16.06.98) by Bert Jahn";
  24.   defbuildfile = ".build";
  25.  
  26. VAR
  27.   buffer  : ARRAY 256 OF CHAR; (* the comment *)
  28.   build   : LONGINT;
  29.   file    : fs.File;
  30.   bool    : BOOLEAN;
  31.  
  32.  
  33. (* main *)
  34. BEGIN
  35.   SYS.SETREG(8,SYS.ADR(version));    (* that the version string will linked *)
  36.   IF d.base.lib.version < 37 THEN
  37.     HALT(20);
  38.   ELSE
  39.     IF fs.Open(file,defbuildfile,FALSE) THEN
  40.       IF fs.ReadString(file,buffer) THEN
  41.         bool := conv.StringToInt(buffer,build);
  42.       END;
  43.       bool := fs.Close(file);
  44.     END;
  45.     INC(build);
  46.     conv.IntToStringLeft(build,buffer);
  47.     IF fs.Open(file,defbuildfile,TRUE) THEN
  48.       bool := fs.WriteString(file,buffer);
  49.       bool := fs.Close(file);
  50.     END;
  51.     d.PrintF("%ld",build);
  52.   END
  53. END WBuild.
  54.  
  55.